package cn.codeforfun.goods;

import cn.codeforfun.goods.dao.GoodsDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * Created by Administrator on 2016/12/18 0018.
 */
@Service
@Transactional
public class GoodsService {
    @Autowired
    private GoodsDao goodsDao;

    public Page<Goods> goodsPage(Pageable pageable) {
        Page<Goods> goodsPage = goodsDao.findAll(pageable);
        return goodsPage;
    }

    public Goods findOne(Integer id) {
        return goodsDao.findOne(id);
    }
}
